﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TrackingSim.ResourceSystem
{
    public class Resource
    {
        private string m_path;
        private string m_name;
        private string m_group_name;

        public Resource()
        {
        }

        public Resource(string path)
        {
            m_path = path;

            //Extract name from path
            int last_slash = path.LastIndexOfAny(new char[] { '/', '\\' });
            if (last_slash == -1) last_slash = 0;
            int last_dot = path.LastIndexOf('.');

            m_name = path.Substring(last_slash, last_dot);
        }

        public Resource(string name, string path)
        {
            m_name = name;
            m_path = path;
        }

        public string Path
        {
            get { return m_path; }
            set { m_path = value; }
        }

        public string Name
        {
            get { return m_name; }
            set { m_name = value; }
        }

        public string GroupName
        {
            get { return m_group_name; }
            set { m_group_name = value; }
        }

    }
}
